package rof
import (
"encoding/binary"
"math"
)
type sRofLanguageRow struct {
mID int32
mKey string
mDesc string
mChineseSimplified string
mChineseTraditional string
mEnglish string
}
func (pOwn *sRofLanguageRow) readBody(aBuffer []byte) int32 {
var nOffset int32
pOwn.mID = int32(binary.BigEndian.Uint32(aBuffer[nOffset:]))
nOffset+=4
nKeyLen := int32(binary.BigEndian.Uint32(aBuffer[nOffset:]))
nOffset+=4
pOwn.mKey = string(aBuffer[nOffset:nOffset+nKeyLen])
nOffset+=nKeyLen
nDescLen := int32(binary.BigEndian.Uint32(aBuffer[nOffset:]))
nOffset+=4
pOwn.mDesc = string(aBuffer[nOffset:nOffset+nDescLen])
nOffset+=nDescLen
nChineseSimplifiedLen := int32(binary.BigEndian.Uint32(aBuffer[nOffset:]))
nOffset+=4
pOwn.mChineseSimplified = string(aBuffer[nOffset:nOffset+nChineseSimplifiedLen])
nOffset+=nChineseSimplifiedLen
nChineseTraditionalLen := int32(binary.BigEndian.Uint32(aBuffer[nOffset:]))
nOffset+=4
pOwn.mChineseTraditional = string(aBuffer[nOffset:nOffset+nChineseTraditionalLen])
nOffset+=nChineseTraditionalLen
nEnglishLen := int32(binary.BigEndian.Uint32(aBuffer[nOffset:]))
nOffset+=4
pOwn.mEnglish = string(aBuffer[nOffset:nOffset+nEnglishLen])
nOffset+=nEnglishLen
return nOffset
}
func (pOwn *sRofLanguageRow) GetID() int32 { return pOwn.mID } 
func (pOwn *sRofLanguageRow) GetKey() string { return pOwn.mKey } 
func (pOwn *sRofLanguageRow) GetDesc() string { return pOwn.mDesc } 
func (pOwn *sRofLanguageRow) GetChineseSimplified() string { return pOwn.mChineseSimplified } 
func (pOwn *sRofLanguageRow) GetChineseTraditional() string { return pOwn.mChineseTraditional } 
func (pOwn *sRofLanguageRow) GetEnglish() string { return pOwn.mEnglish } 
type sRofLanguageTable struct { 
mRowNum int32
mColNum int32
mIDMap  map[int32]*sRofLanguageRow
mRowMap map[int32]int32
}
func (pOwn *sRofLanguageTable) newTypeObj() iRofRow {return new(sRofLanguageRow)}
func (pOwn *sRofLanguageTable) setRowNum(aNum int32) {pOwn.mRowNum = aNum}
func (pOwn *sRofLanguageTable) setColNum(aNum int32) {pOwn.mColNum = aNum}
func (pOwn *sRofLanguageTable) setIDMap(aKey int32, aValue iRofRow) {pOwn.mIDMap[aKey] = aValue.(*sRofLanguageRow)}
func (pOwn *sRofLanguageTable) setRowMap(aKey int32, aValue int32) {pOwn.mRowMap[aKey] = aValue}
func (pOwn *sRofLanguageTable) init(aPath string) bool {
pOwn.mIDMap = make(map[int32]*sRofLanguageRow)
pOwn.mRowMap = make(map[int32]int32)
return analysisRof(aPath, pOwn)
}
func (pOwn *sRofLanguageTable) GetDataByID(aID int32) *sRofLanguageRow {return pOwn.mIDMap[aID]}
func (pOwn *sRofLanguageTable) GetDataByRow(aIndex int32) *sRofLanguageRow {
nID, ok := pOwn.mRowMap[aIndex]
if ok == false {return nil}
return pOwn.mIDMap[nID]
}
func (pOwn *sRofLanguageTable) GetRows() int32 {return pOwn.mRowNum}
func (pOwn *sRofLanguageTable) GetCols() int32 {return pOwn.mColNum}
